This invention relate; to a computer having memory protection function, a computer readable recording medium adapted so that address validity collation program is recorded, and an address validity collation method at such a computer, and more particularly to a computer having function in which, in response to request of an object, other object provides memory access, a computer readable recording medium adapted so that address validity collation program executed at such a computer is recorded, and an address validity collation method at such a computer.
In order to execute program on the computer, it is necessary to protect memory by any means. For example, there are instances where object executed on the computer may intentionally or resultantly issue invalid or inaccurate access request with respect to memory area except for address area permitted with respect to the own object during its execution. Here, it is preferable that object is parallel object referred to in the U.S. patent application Ser. No. 08/678,288 U.S. Pat. No. 6,138,140, in which the invention by the same applicant as this applicant is described. Parallel object is execution unit of process, and is such an object capable of carrying out processing in parallel to other parallel object. In order to maintain stable operation of security or the system, it is necessary to exclude access to invalid address area. In view of the above, in many operating systems, memory protection is realized by utilizing memory management system of processor.
Explanation will now be given in connection with processing of memory protection when access to invalid address area takes place.
FIG. 1 is a block diagram for explaining conventional memory protective operation. Operating system 110 carries out context switch in starting execution of object 101 and sets memory protection information that corresponding object 101 has at memory management system 121 of processor 120. Further, accesses from the object 101 to memory 102 are carried out all through the memory management system 121. In this instance, the memory management system 121 carries out check as to whether or not designated address infringes memory protection information set at present in the memory management system 121. As a result, in the case where there is no infringement, access to actual memory 102 is provided. On the other hand, in the case where there is any infringement, memory access is not carried out, but exception is generated by the memory management system 121. Information of that exception is notified to the operating system 110. The operating system 110 analyses exception phenomenon to provide exception processing service corresponding thereto.
In a manner as stated above, access only to a predetermined memory space can be provided from the object 101. Thus, memory is protected.
Moreover, there are also cases where object 101 carries out memory access through operating system 110. In such cases, collation relating to validity of address is carried out in the operating system 110. For example, the operating system 110 provides service for responding to request from object 101, e.g., system call or API (Application Programing Interface) and there are instances where address is delivered from object 101 at the time of such service request. Ordinarily, this address designates address area permitted for the object 101 and the operating system 110 provides access to such area to carry out service. The operation at this time will be described below.
FIG. 2 is a block diagram for explaining the operation of address collation by the operating system 110. When the operating system 110 receives service request including address from the object 101, it investigates or checks validity of address at address collation module 111 before it executes actual service at service processing object 112. This is necessary processing for the reason described below.
Ordinarily, the operating system 110 has access right with respect to address area of object 101 in addition to address area of the operating system 110 itself for the purpose of realizing service. For this reason, even in the case where address delivered from the object 101 inaccurately designates address area of the operating system 110, validity cannot be discriminated in memory management system 121 that processor 120 has so that access thereto can be provided. Accordingly, there arises the necessity to discriminate validity of address in advance.
Validity collation of address is ordinarily carried out by sequentially collating, by address collation module 111, whether or not address delivered infringes memory protection information that object 101 has. Collation result of address is delivered to service processing object 112. In the case where it is judged that its result is invalid (inaccurate) address, error is sent back to the, object 101 as service result.
However, when there is carried out memory access utilizing function that the operating system 110 provides by the above-described method, it is necessary to carry out validity collation of address at address collation module 111 before address delivered from object 101 is actually used in the operating system 110, giving rise to the problem that execution processing speed is lowered.
In addition, a method which dose does not collate validity of address is conceivable. In this case, however, since the case where address delivered from the object 101 designates destination of storage of data within the operating system 110, etc. cannot be checked, there arise the problems that data of the operating system 110 is broken and access is inaccurately provided.
As stated above, the conventional operating systems are required to necessarily carry out validity collation of address before address delivered from object is actually used. For this reason, when validity collation of address is carried out, there was the drawback that the execution speed is lowered in accordance with quantity of memory protective information.
This invention has been made in view of such circumstances, and its object is to provide a computer capable of carrying out, at high speed, with high reliability, memory access that, in accordance with request of an object, other object executes.
Another object of this invention is to provide a computer readable recording medium adapted so that there is recorded exception processing program for permitting the computer to carry out, at high speed, with high reliability, memory access that, in accordance with request of an object, other object executes.
A further object of this invention is to provide an exception processing method for executing, at high speed, with high reliability, memory access that, in accordance with request of an object, other objects executes.
In order to solve the above-described problems, the computer according to this invention is directed to a computer having a function to protect memory by permitting access only to address area designated by memory protection information, the computer comprising: request processing means adapted so that when it receives processing request including memory access to designated address, it executes processing in accordance with the processing request, and when memory access takes place, it outputs access request to address designated by processing request; memory access proxy (agent) means adapted to receive the access request that the request processing means outputs to set memory protection information in which area where object which has outputted processing request can access is caused to be accessible area to output, to processor, memory access instruction corresponding to the access request; and memory management means adapted so that when the memory access instruction that the memory access proxy (agent) means outputs is access except for area set in the memory protection information, it generates exception with respect to the memory access instruction.
In accordance with such a computer, when processing request including memory access to designated address is outputted, its processing request is received the by request processing means. Thus, processing in accordance with the request is executed. In this instance, when memory access takes place, access request to address designated by processing request is outputted by the request processing means. Thus, access request is received by the memory access proxy means. As a result, there is set memory protection information in which area that object which has outputted processing request can access is caused to be accessible area. In that state, by the memory access proxy means, memory access instruction corresponding to the access request is outputted to the processor. On the other hand, when memory access instruction that the memory access proxy means outputs is access except for area set in the memory protection information, exception with respect to the memory access instruction is caused to take place by the memory management means.
Further, in order to solve the above-described problems, the recording medium adapted so that address validity collation program is recorded according to this invention is directed to a computer readable recording medium adapted so that there is recorded address validity collation program executed by processor having such a memory management function that when memory access instruction is access except for area set in memory protection information, exception with respect to memory access instruction is caused to take place, wherein computer is caused to function as request processing means such that when it receives processing request including memory access to designated address, it executes processing: in accordance with the processing request, and when memory access takes place, it outputs access request to address designated by processing request, and memory access proxy (agent) means adapted to receive access request that the request processing means has outputted to set memory protection information in which area that object which has outputted processing request can access is caused to be accessible area to output, to the processor, memory access instruction in accordance with the access request.
When address validity collation program recorded with respect to such a recording medium is caused to be executed by computer, functions necessary for the above-described computer according to this invention are constructed.
In addition, in order to solve the above-described problems, the address validity collation method according to this invention is directed to an address validity collation method using processor having function to protect memory by permitting access only to address area designated by memory protection information, wherein when processing request including memory access to designated address is outputted, processing in accordance with the processing request is executed, and when memory access takes place during execution of processing request, memory protection information in which area that object which has outputted processing request can access is caused to be accessible area is set to output, to the processor, instruction for carrying out memory access taking place during execution of the processing request.
In accordance with the address validity collation method as stated above, when processing request including memory access to the designated address is outputted, its processing request is executed. When memory access takes place during execution, there is set memory protection information in which area that object which has outputted processing request can access is caused to be accessible. Thereafter, instruction for carrying out memory access is outputted to the processor.